<?php

/**
 * 调用文档
 *
 * @package    01CMS
 * @subpackage plugin
 * @author     rolong at vip.qq.com
 * @version    1.0.0
 * @link       http://www.01cms.com
 */

function smarty_block_archive ($params, $content, $smarty, &$repeat)
{
    static $data = array();

    if (is_null($content))
    {   
        $Model = model('Archive');
        $data = $Model->getArchives($params);
        $data = $Model->setArchiveFlag($data);
    }
    
    if ($o = current($data))
    {
        $smarty->assign('item', $o);
        next($data);
        $repeat = true;
    }
    else
    {
        $repeat = false;
    }
    
    return $content;
}
